Skip to content

CS-10616: Reimplement boxel workspace pull command#4355

Merged
FadhlanR merged 5 commits intomainfrom
cs-10616-reimplement-boxel-pull-command
Apr 14, 2026
Merged

CS-10616: Reimplement boxel workspace pull command#4355
FadhlanR merged 5 commits intomainfrom
cs-10616-reimplement-boxel-pull-command

Conversation

@FadhlanR
Copy link
Copy Markdown
Contributor

@FadhlanR FadhlanR commented Apr 8, 2026

Summary

  • Port boxel workspace pull command from standalone boxel-cli into monorepo
  • Register under boxel realm pull subcommand
  • Add comprehensive test infrastructure: mock fetch router, mock Matrix/Realm servers

Test plan

  • pnpm --filter @cardstack/boxel-cli test — 31 tests pass
  • pnpm --filter @cardstack/boxel-cli build — builds successfully
  • pnpm --filter @cardstack/boxel-cli lint — no errors

🤖 Generated with Claude Code

Port pull command and shared libraries from standalone boxel-cli.
Adds MatrixClient, RealmAuthClient, RealmSyncBase, and CheckpointManager
shared libs. Registers pull under `boxel workspace pull` subcommand.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@habdelra
Copy link
Copy Markdown
Contributor

now that we have real realm integration don't forget to add tests for this against a running realm

…eding

- Update noopPrerenderer to return a valid RenderResponse with error field
  so the indexer handles it gracefully instead of crashing on undefined
- Seed test realm files via fileSystem parameter (matching realm-server
  test pattern) instead of HTTP POST via seedRealmFile
- Add missing test cases: preserves local-only files, recursive subdirs
- Remove unused seedRealmFile helper and mock test infrastructure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FadhlanR FadhlanR force-pushed the cs-10616-reimplement-boxel-pull-command branch from a0bf836 to d20a12f Compare April 14, 2026 07:39
@FadhlanR FadhlanR changed the base branch from cs-10615-reimplement-boxel-profile-command to main April 14, 2026 07:40
@github-actions
Copy link
Copy Markdown

Host Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit d20a12f.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

@FadhlanR FadhlanR marked this pull request as ready for review April 14, 2026 08:03
@FadhlanR FadhlanR requested review from a team, habdelra and jurgenwerk April 14, 2026 08:03
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cf154049c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/boxel-cli/src/lib/profile-manager.ts Outdated
Comment thread packages/boxel-cli/src/commands/realm/pull.ts
Comment thread packages/boxel-cli/src/lib/profile-manager.ts Outdated
Comment thread packages/boxel-cli/src/lib/profile-manager.ts Outdated
@FadhlanR FadhlanR force-pushed the cs-10616-reimplement-boxel-pull-command branch from 0f3051f to b407dcf Compare April 14, 2026 08:48
…only checkpoints

- Split authedFetch into authedRealmFetch and authedRealmServerFetch for clarity
- Fix P1: handle expired server token during realm-auth prefetch gracefully
  so the 401 retry path still works
- Fix P2: persist checkpoint after delete-only pulls (not just downloads)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FadhlanR FadhlanR force-pushed the cs-10616-reimplement-boxel-pull-command branch from b407dcf to 6d437cb Compare April 14, 2026 08:51
@FadhlanR FadhlanR merged commit 72d1f10 into main Apr 14, 2026
22 checks passed
Copy link
Copy Markdown
Contributor

@habdelra habdelra Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really reimplementing this? this looks almost exactly the same as the old implementation

Image

Comment on lines +63 to +71
for (const [relativePath] of remoteFiles) {
try {
const localPath = path.join(this.options.localDir, relativePath);
await this.downloadFile(relativePath, localPath);
downloadedFiles.push(relativePath);
} catch (error) {
this.hasError = true;
console.error(`Error downloading ${relativePath}:`, error);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is downloading files seriallly? why? we should be downloading files concurrently

Comment on lines +104 to +112
for (const relativePath of filesToDelete) {
try {
const localPath = localFiles.get(relativePath);
if (localPath) {
await this.deleteLocalFile(localPath);
deletedFiles.push(relativePath);
console.log(` Deleted: ${relativePath}`);
}
} catch (error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we doing these batch operations serially? we should be using atomic operations for this

Comment on lines +82 to +97
const checkpointManager = new CheckpointManager(this.options.localDir);
const deleteChanges: CheckpointChange[] = Array.from(filesToDelete).map(
(f) => ({
file: f,
status: 'deleted' as const,
}),
);
const preDeleteCheckpoint = checkpointManager.createCheckpoint(
'remote',
deleteChanges,
`Pre-delete checkpoint: ${filesToDelete.size} files not on server`,
);
if (preDeleteCheckpoint) {
console.log(
`\nCheckpoint created before deletion: ${preDeleteCheckpoint.shortHash}`,
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are the tests for the checkpoint stuff here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs tests

@habdelra
Copy link
Copy Markdown
Contributor

habdelra commented Apr 14, 2026

so per our discussion with @lukemelia yes, we are copying this over and making targetted adjustments as we see them. sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants